<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCarouselPicCategoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('c_carousel_pic_categories')) {
            Schema::create('c_carousel_pic_categories', function (Blueprint $table) {
                $table->increments('id')->comment('自增ID');
                $table->string('carousel_pic_id')->comment('图片类别');
                $table->string('pic')->comment('图片路径');
                $table->string('url')->comment('链接地址')->nullable();
                $table->timestamps();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('c_carousel_pic_categories');
    }
}
